/*
 * Graphics.h
 *
 *  Created on: 10/07/2010
 *      Author: Nenem
 */

#ifndef GRAPHICS_H_
#define GRAPHICS_H_

#define BITSPERPIXEL 32

#include <SDL/SDL.h>
#include "SDL/SDL_image.h"
#include <SDL/SDL_TTF.h>

#include <string>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

#include "Image.h"
#include "Tools.h"

class Graphics {
public:
	int RESOLUTION_Y;
	int RESOLUTION_X;
//	SDL_Surface *layerA;
//	SDL_Surface *layerB;
	vector<Image*> sprites;
	SDL_Surface *Screen;
	Graphics();
	virtual ~Graphics();
	void Draw(int x, int y, SDL_Surface *layerA, SDL_Surface *layerB);
	void sortVector();
	void updateScreen();
	void addImage(Image *image);
	void getTalkSurface(string text);
};

void PrintStrings( SDL_Surface *sDest, TTF_Font *fnt, string str,
                   SDL_Rect &rc, SDL_Color clrFg, SDL_Color clrBg );
SDL_Rect newSDL_Rect( int xs,int ys, int dx,int dy );
SDL_Color newSDL_Color( int r, int g, int b, int a );
SDL_Color newSDL_Color( int r, int g, int b );
bool operator==(SDL_Color a, SDL_Color b);
bool operator!=(SDL_Color a, SDL_Color b);
int SDL_MapRGB( SDL_PixelFormat *format, SDL_Color clr );
int SDL_FillRect( SDL_Surface *dest, SDL_Rect *rc, SDL_Color &clr );
bool compareSprites(Image *A, Image *B);

#endif /* GRAPHICS_H_ */
